<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理员后台 - 学生成绩管理系统</title>
    <style>
        /* ===== 全局和重置 ===== */
        body, html {
            margin: 0;
            padding: 0;
            font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
            background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
            color: #333;
            height: 100%;
        }

        * {
            box-sizing: border-box;
        }

        /* ===== 整体布局 ===== */
        .admin-layout {
            display: flex;
            width: 100%;
            min-height: 100vh;
        }

        /* ===== 侧边栏 (Sidebar) ===== */
        .sidebar {
            width: 260px;
            background: linear-gradient(180deg, #1565c0 0%, #1976d2 100%);
            color: #fff;
            display: flex;
            flex-direction: column;
            position: fixed;
            height: 100%;
            overflow-y: auto;
            box-shadow: 4px 0 20px rgba(21, 101, 192, 0.15);
            z-index: 100;
        }

        .sidebar-header {
            padding: 30px 20px;
            text-align: center;
            font-size: 22px;
            font-weight: bold;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            background: rgba(0, 0, 0, 0.1);
        }

        .sidebar-header h3 {
            margin: 0;
            color: #ffffff;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .nav-menu {
            list-style: none;
            padding: 20px 0;
            margin: 0;
        }

        .nav-item {
            margin: 5px 15px;
        }

        .nav-link {
            display: flex;
            align-items: center;
            padding: 14px 20px;
            color: rgba(255, 255, 255, 0.85);
            text-decoration: none;
            font-size: 15px;
            border-radius: 10px;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
        }

        .nav-link::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            height: 100%;
            width: 3px;
            background: #fff;
            transform: scaleY(0);
            transition: transform 0.3s;
        }

        .nav-link .icon {
            margin-right: 15px;
            font-size: 20px;
            transition: transform 0.3s;
        }

        .nav-link:hover {
            background: rgba(255, 255, 255, 0.15);
            color: #fff;
            transform: translateX(5px);
        }

        .nav-link:hover .icon {
            transform: scale(1.2);
        }

        .nav-link.active {
            background: #2196f3;
            color: #fff;
            font-weight: 600;
            box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
        }

        .nav-link.active::before {
            transform: scaleY(1);
        }

        /* ===== 主内容区 (Main Content) ===== */
        .main-content {
            flex: 1;
            margin-left: 260px;
            display: flex;
            flex-direction: column;
            background: #f5f9fc;
        }

        /* ===== 顶部栏 (Header) ===== */
        .header {
            background: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(10px);
            padding: 20px 35px;
            box-shadow: 0 2px 20px rgba(21, 101, 192, 0.08);
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid rgba(21, 101, 192, 0.1);
            position: sticky;
            top: 0;
            z-index: 50;
        }

        .header h1 {
            margin: 0;
            font-size: 26px;
            color: #1565c0;
            font-weight: 700;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .user-info span {
            font-size: 15px;
            color: #546e7a;
        }

        .user-info strong {
            color: #1565c0;
        }

        .user-info .user-role {
            background: #2196f3;
            color: white;
            padding: 6px 16px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: 600;
            box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
        }

        .logout-btn {
            padding: 10px 20px;
            background: #1976d2;
            border: none;
            color: white;
            border-radius: 25px;
            cursor: pointer;
            transition: all 0.3s;
            font-weight: 600;
            box-shadow: 0 4px 15px rgba(25, 118, 210, 0.3);
        }

        .logout-btn:hover {
            background: #1565c0;
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(21, 101, 192, 0.4);
        }

        /* ===== 核心内容区 (Content Area) ===== */
        .content-area {
            flex: 1;
            padding: 35px;
            overflow-y: auto;
        }

        /* 仪表板卡片样式 */
        .stats-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 25px;
            margin-bottom: 35px;
        }

        .card {
            background: white;
            padding: 30px;
            border-radius: 20px;
            box-shadow: 0 8px 30px rgba(21, 101, 192, 0.08);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
            border: 1px solid rgba(21, 101, 192, 0.1);
        }

        .card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 4px;
            background: linear-gradient(90deg, #1976d2 0%, #2196f3 100%);
        }

        .card:hover {
            transform: translateY(-8px);
            box-shadow: 0 15px 40px rgba(21, 101, 192, 0.15);
            border-color: #2196f3;
        }

        .card h3 {
            margin: 0 0 15px 0;
            color: #546e7a;
            font-size: 15px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .card .stat-number {
            font-size: 38px;
            font-weight: 700;
            color: #1976d2;
            margin: 0;
        }

        /* 仪表板其他模块 */
        .content-modules {
            display: grid;
            grid-template-columns: 2fr 1fr;
            gap: 25px;
        }

        .module-card {
            background: white;
            padding: 30px;
            border-radius: 20px;
            box-shadow: 0 8px 30px rgba(21, 101, 192, 0.08);
            transition: all 0.3s;
            border: 1px solid rgba(21, 101, 192, 0.1);
        }

        .module-card:hover {
            box-shadow: 0 12px 40px rgba(21, 101, 192, 0.15);
            border-color: #2196f3;
        }

        .module-card h3 {
            margin: 0 0 20px 0;
            font-size: 18px;
            color: #1565c0;
            font-weight: 700;
        }

        .chart-placeholder {
            height: 280px;
            background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #1976d2;
            border-radius: 15px;
            margin-top: 20px;
            font-size: 18px;
            font-weight: 600;
            position: relative;
            overflow: hidden;
            border: 2px dashed rgba(25, 118, 210, 0.3);
        }

        .chart-placeholder::before {
            content: '';
            position: absolute;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.5), transparent);
            animation: shimmer 3s infinite;
        }

        @keyframes shimmer {
            0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
            100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
        }

        .quick-actions {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .quick-actions button {
            width: 100%;
            padding: 16px;
            background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
            color: white;
            border: none;
            border-radius: 12px;
            cursor: pointer;
            font-size: 15px;
            font-weight: 600;
            transition: all 0.3s;
            box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
        }

        .quick-actions button:hover {
            background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(21, 101, 192, 0.4);
        }

        /* 滚动条美化 */
        ::-webkit-scrollbar {
            width: 8px;
        }

        ::-webkit-scrollbar-track {
            background: #e3f2fd;
        }

        ::-webkit-scrollbar-thumb {
            background: #2196f3;
            border-radius: 10px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: #1976d2;
        }

        /* 响应式设计 */
        @media (max-width: 1024px) {
            .content-modules {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .sidebar {
                width: 70px;
            }

            .sidebar-header h3 {
                font-size: 16px;
            }

            .nav-link span:not(.icon) {
                display: none;
            }

            .main-content {
                margin-left: 70px;
            }

            .stats-cards {
                grid-template-columns: 1fr;
            }
        }
    </style>
</head>
<body>

<div class="admin-layout">
    <nav class="sidebar">
        <div class="sidebar-header">
            <h3>学生成绩管理系统</h3>
        </div>
        <ul class="nav-menu">
            <li class="nav-item">
                <a href="#dashboard" class="nav-link active">
                    <span class="icon">📊</span>
                    <span>仪表板</span>
                </a>
            </li>
            <li class="nav-item">
                <a href="#user-manage" class="nav-link">
                    <span class="icon">👥</span>
                    <span>用户管理</span>
                </a>
            </li>
            <li class="nav-item">
                <a href="#college-manage" class="nav-link">
                    <span class="icon">🏛️</span>
                    <span>学院管理</span>
                </a>
            </li>
            <li class="nav-item">
                <a href="#class-manage" class="nav-link">
                    <span class="icon">🏫</span>
                    <span>班级管理</span>
                </a>
            </li>
            <li class="nav-item">
                <a href="#grade-manage" class="nav-link">
                    <span class="icon">📈</span>
                    <span>成绩管理</span>
                </a>
            </li>
            <li class="nav-item">
                <a href="#announcement-manage" class="nav-link">
                    <span class="icon">📢</span>
                    <span>公告管理</span>
                </a>
            </li>
        </ul>
    </nav>

    <div class="main-content">
        <header class="header">
            <div class="header-title">
                <h1>仪表板</h1>
            </div>
            <div class="user-info">
                <span>欢迎, <strong>Admin</strong></span>
                <span class="user-role">管理员</span>
                <button class="logout-btn" onclick="alert('退出登录')">退出</button>
            </div>
        </header>

        <main class="content-area" id="dashboard">

            <div class="stats-cards">
                <div class="card">
                    <h3>学生总数</h3>
                    <p class="stat-number">1,200</p>
                </div>
                <div class="card">
                    <h3>教师总数</h3>
                    <p class="stat-number">150</p>
                </div>
                <div class="card">
                    <h3>班级总数</h3>
                    <p class="stat-number">45</p>
                </div>
                <div class="card">
                    <h3>最新公告</h3>
                    <p class="stat-number">5</p>
                </div>
            </div>

            <div class="content-modules">
                <div class="module-card">
                    <h3>近期成绩分布 (示例)</h3>
                    <div class="chart-placeholder">📊 图表区域</div>
                </div>
                <div class="module-card">
                    <h3>快捷操作</h3>
                    <div class="quick-actions">
                        <button>📢 发布新公告</button>
                        <button>➕ 添加新用户</button>
                        <button>📤 导入成绩</button>
                    </div>
                </div>
            </div>

        </main>
    </div>
</div>

<script>
    // 导航菜单交互
    document.querySelectorAll('.nav-link').forEach(link => {
        link.addEventListener('click', function(e) {
            e.preventDefault();
            document.querySelectorAll('.nav-link').forEach(l => l.classList.remove('active'));
            this.classList.add('active');

            const section = this.getAttribute('href').substring(1);
            document.querySelector('.header h1').textContent = this.textContent.trim();
        });
    });

    // 为统计卡片添加数字动画效果
    function animateNumber(element, target) {
        const duration = 1000;
        const start = 0;
        const increment = target / (duration / 16);
        let current = start;

        const timer = setInterval(() => {
            current += increment;
            if (current >= target) {
                element.textContent = target.toLocaleString();
                clearInterval(timer);
            } else {
                element.textContent = Math.floor(current).toLocaleString();
            }
        }, 16);
    }

    // 页面加载时启动数字动画
    window.addEventListener('load', () => {
        document.querySelectorAll('.stat-number').forEach(el => {
            const target = parseInt(el.textContent.replace(',', ''));
            animateNumber(el, target);
        });
    });
</script>

</body>
</html>